<template>
  <DHPlayerCore ref="video" :videoId="id" :pathList="pathList" @getError="getError" />
</template>

<script>
import { uniqueId } from 'lodash-es';
import DHPlayerCore from './DHPlayer.vue';
export default {
  name: 'DHPlayer',
  components: { DHPlayerCore },
  props: {
    streamUrl: { type: [String, Array], default: '' },
  },
  data() {
    return {
      id: 'DHPlayer-' + uniqueId(),
    };
  },
  computed: {
    pathList() {
      return Array.isArray(this.streamUrl) ? this.streamUrl : [this.streamUrl];
    },
  },
  methods: {
    getError(msg) {
      alert(msg);
    },
  },
};
</script>

<style></style>
